package com.makenv.util;

import org.springframework.stereotype.Component;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

;/**
 * @Author : lilimin
 * @Description : 读取去web-config.properties配置文件
 * @Date : Created in 12:02 2017/11/24
 */
@Component
public class Config {

    private static Properties properties = null;

    public Config() {

        properties = new Properties();
        InputStream in = this.getClass().getResourceAsStream("/web-config.properties");
        try {
            properties.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static int getInt(String str) {
        return Integer.parseInt(properties.getProperty(str));
    }

    public static String getString(String key) {
        return properties.getProperty(key);
    }
}
